@extends('layouts.console_main')
@section('resources')
    @parent
    <style type="text/css">
        #container{ width:90%; height: 500px;}
    </style>
    @endsection
@section('content')
        <!-- page content -->
<div class="right_col" role="main">
    <div class="">
        <div class="page-title">
            <div class="title_left">
                <h2>水表管理  >>  线路图 </h2>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>地图</h2>
                        <ul class="nav navbar-right panel_toolbox">
                            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">Settings 1</a>
                                    </li>
                                    <li><a href="#">Settings 2</a>
                                    </li>
                                </ul>
                            </li>
                            <li><a class="close-link"><i class="fa fa-close"></i></a>
                            </li>
                        </ul>
                        <div class="clearfix"></div>
                    </div>

                    <div class="x_content">
                        <div class="table-responsive">
                            <div id="container"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /page content -->
@endsection
@section('scriptResources')
    @parent
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.3&key=a9fe1b184bacd00ecd70365903024419&plugin=AMap.Autocomplete"></script>
    <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
    <script>

//        var lntlatXY;
        var map = new AMap.Map("container", {
            resizeEnable: true,
            zoom: 15,
            center:[115.953115, 28.674775]
        });
        marker = new AMap.Marker({  //加点
            map: map,
            position:[115.953115, 28.674775],
            title:name,
            clickable:true
        });
        new AMap.Marker({  //加点
            map: map,
            position:[115.95306, 28.675979],
            title:name
        });
        map.setFitView();
        AMap.service('AMap.Walking',function(){//回调函数
            //实例化Walking
            walking= new AMap.Walking({city: '南昌市'});
            walking.search([115.953115, 28.674775], [115.95306, 28.675979], function(status, result) {
                //TODO 解析返回结果，自己生成操作界面和地图展示界面
            });
            //TODO: 使用walking对象调用步行路径规划相关的功能
        })
//        MWalk = new AMap.Walking({
//            map: map,
//            panel: "result"
//        });
//        //传经纬度
//        walking.search([115.953115, 28.674775], [115.95306, 28.675979], function(status, result) {
//            //TODO 解析返回结果，自己生成操作界面和地图展示界面
//        });
//        //传名称、城市信息
//        walking.search([{keyword:'梦时代',city:'南昌'},{keyword:'江西省计量测试研究院',city:'南昌'}], function(status, result){
//            //TODO 解析返回结果，自己生成操作界面和地图展示界面
//        });
    </script>
@endsection

